<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<style type="text/css">
.selectWidth1{
   width:75px;
}
.selectWidth2{
   width:185px;
}

</style>
<div class="t_bar">
	<span class="color_red">*</span>人员情况（单位：人）
</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
	cellspacing="1" id="persons_psncnt">
<tr >
		<td align="right" rowspan="3">人员总数：</td>
		<td rowspan="3">
		<span name="persons/psncnt_total" id="psncnt_total"><x:out select="$xmlData/data/organization_persons/people_count_total" /></span>
		</td>
		<td align="right" >硕士(含以上)：</td>
		<td ><span id="psncnt_master" name="persons/psncnt_master"><x:out select="$xmlData/data/persons/psncnt_master" /></span>
		<input type="hidden" id="degree_doctor" value="<x:out select="$xmlData/data/organization_persons/degree_doctor" />"/>
		<input type="hidden" id="degree_master" value="<x:out select="$xmlData/data/organization_persons/degree_master" />"/>
		</td>
		<td align="right" >高级职称：</td>
		<td >
		<span name="persons/psncnt_prof_title_high" ><x:out select="$xmlData/data/organization_persons/prof_title_high" /></span>
		</td>
		<td align="right" >专职人员数量：</td>
		<td ><input type="text" id="psncnt_full_time"
			name="persons/psncnt_full_time" class=" required" label="专职人员数量"
			onfocus="InitInput.setNumber(this,7,0,0)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/persons/psncnt_full_time" />" />
		</td>
	</tr>

	<tr >
		<td align="right" >大学本科：</td>
		<td ><span name="persons/psncnt_degree_bachelor"><x:out select="$xmlData/data/organization_persons/degree_bachelor" /></span>
		</td>
		<td align="right" >中级职称：</td>
		<td >
		<span name="persons/psncnt_prof_title_middle" ><x:out select="$xmlData/data/organization_persons/prof_title_middle" /></span>
		</td>
		<td align="right" >管理人员中具有大专以上学历的比例（%）：</td>
		<td ><input type="text" id="psncnt_full_time"
			name="persons/psncnt_manage_percent" class=" required" label="管理人员中具有大专以上学历的比例"
			onfocus="InitInput.setNumber(this,3,2,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/persons/psncnt_manage_percent" />" />
		</td>
	</tr>
	<tr >
		<td align="right" >大专：</td>
		<td ><span name="persons/psncnt_degree_college"><x:out select="$xmlData/data/organization_persons/degree_college" /></span>
		</td>
		<td align="right" >初级职称：</td>
		<td >
		<span name="persons/psncnt_prof_title_junior" ><x:out select="$xmlData/data/organization_persons/prof_title_junior" /></span>
		</td>
		<td align="right" >兼职人员占总人数的比例（%）：</td>
		<td ><input type="text" id="psncnt_part_time"
			name="persons/psncnt_part_time" class="required" label="兼职人员占总人数的比例"
			onfocus="InitInput.setNumber(this,3,2,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/persons/psncnt_part_time" />" />
		</td>
	</tr>
</table>
<br/>
<div class="t_bar">
	<span class="color_red">*</span>平台主要负责人基本情况及主要个人简历
</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
	cellspacing="1" id="persons_principal">
<tr>
<td align="right">姓名：</td>
<td>
<input type="text" id="cnameFuzeren" name="persons/principal_name" class="required" label="姓名" maxlength="50" value="<x:out select="$xmlData/data/persons/principal_name" />" />

 <input type="hidden" name="principal_name" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/zh_name"/>">

 <security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
			    	<script type="text/javascript">
			    	$(document).ready(function(){
			    		$("#cnameFuzeren").attr("disabled","disabled");
			    	});
			    	</script>
					<span id="personSelect">
					<input type="button" class="button_02" style="height: 25px; padding: 1px;" id="selectPsn" value="设置">
					<cpt:personSelect key="personSelect" addRole="3" callback="selectPsnCall" bindEvent="click" bindObject="selectPsn" title="项目核心人员" fltFile="personSelector.ftl"></cpt:personSelect>
					</span>
				</security:authorize>
</td>
<td align="right">出生年月：</td>
<td ><c:set var="principal_bod"><x:out select="$xmlData/data/persons/principal_bod" /></c:set> 
<cpt:date id="principal_bod" name="persons/principal_bod" value="${principal_bod}" className="required date" label="出生年月"></cpt:date>
 <input type="hidden" name="principal_bod" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/birthday" />">
</td>
<td align="right">最高学历：</td>
<td >
<c:set var="educate_value"><x:out select="$xmlData/data/persons/educate_value" /></c:set> 
<c:set var='fzr_educate'><x:out select="$xmlData/data/zh_persons/zh_person/basic_info/educate_value" /></c:set>
<c:if test="${educate_value=='' }">
<cpt:select id="educate" key="educate"  value="${fzr_educate}" className="required" label="最高学历"></cpt:select>
</c:if>
<c:if test="${educate_value!='' }">
<cpt:select id="educate" key="educate"  value="${educate_value}" className="required" label="最高学历"></cpt:select>
</c:if>

<input type="hidden"  name="persons/educate_value" value="${educate_value}" />
<input type="hidden" name="persons/educate_name" value="<x:out select="$xmlData/data/persons/educate_name" />" />
<input type="hidden" name="educate_value" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/educate_value" />">
<input type="hidden" name="educate_name" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/educate_name" />">
</td>
<td align="right">专业：</td>
<td>
<input type="text" name="persons/principal_major" class="required" maxlength="50" label="专业" value="<x:out select="$xmlData/data/persons/principal_major" />" />
<input type="hidden" name="principal_major" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/major"/>">
</td>
</tr>
<tr>
<td align="right">职务：</td>
<td>
<input type="text" name="persons/principal_position" class="required" maxlength="50" label="职务" value="<x:out select="$xmlData/data/persons/principal_position" />" />
<input type="hidden" name="principal_position" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/position"/>">
</td>
<td align="right">移动电话：</td>
<td>
<input type="text" name="persons/principal_mobile" class="required mobile" maxlength="11" label="移动电话"  value="<x:out select="$xmlData/data/persons/principal_mobile" />" />
<input type="hidden" name="principal_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person/contact/mobile" />">
</td>
<td align="right">身份证号：</td>
<td colspan="3">
<input type="text" id="id_no" name="persons/principal_id_no" class="required idCard"  label="身份证号"  value="<x:out select="$xmlData/data/persons/principal_id_no" />" />
<input type="hidden" id="fid_no" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/card_code"/>">
<input type="hidden" id="fid_type_value" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/card_type_value"/>">
			    <script type="text/javascript">
	            $(function() {
		             var id_type_value=$("#fid_type_value").val();
		             var id_no=$("#id_no").val();
		             if(id_type_value==1 && id_no=='' ){
		            	 $("#id_no").val($("#fid_no").val());
		             }
	            });
            </script>
</td>
</tr>
<tr >
<td colspan="8">主要个人简历（限200字）</td>
</tr>
 <tr >
<td colspan="8">
<textarea rows="7" cols="160"  class="input_textarea required  maxlength:200"   name='persons/principal_resume'  label="主要个人简历"><x:out select="$xmlData/data/persons/principal_resume"/></textarea>
 <input type="hidden" name="persons/principal_resume_hidden" value="">
</td>
</tr>
</table>
<br/>
<div class="t_bar">
	<span class="color_red">*</span>主要骨干基本情况
</div>
<table id="tblPersons" border="0" cellspacing="0" cellpadding="0"
	class="t_css table01">
	<thead>
		<tr>
			<th align="center" width="5%" nowrap >选择</th>
			<th align="center" nowrap width="5%" nowrap >序号</th>
			<th align="center" nowrap width="10%" nowrap >姓名</th>
			<th align="center" nowrap width="5%" nowrap >年龄</th>
			<th align="center" nowrap width="5%" nowrap >最高学历</th>
			<th align="center" nowrap width="30%" nowrap >职称</th>
			<th align="center" nowrap width="40%" nowrap >主要业绩</th>

		</tr>
	</thead>
	<tbody id="tab">
		<tr style="display: none">
			<td width="5%" align="center" style="text-align: center"><input
				type="radio" class="radiobutton" name="selPersons"></td>
			<td width="5%" align="center"><span name="persons|person[0]@seq_no">[index]</span></td>
			<td width="10%" align="center"><input name="persons|person[0]|name"
				class="required input_text " maxlength=50 label="姓名" value=""></td>
			<td width="5%" align="center"><input name="persons|person[0]|age" 
				class="required input_text " maxlength=50 label="年龄" style="width:50px;text-align: right;" value="" onfocus="InitInput.setNumber(this,3,0,0)"></td>
			<td width="10%" align="center">
			<cpt:select id="education_background_[index]" name="education_background"  className="selectWidth1" key="educate" onChange="initControlValue(this.id)" value=""></cpt:select>
		     <input type="hidden" name="persons|person[0]|education_background_value" value=""  class="required input_text " label="最高学历"/>
		     <input type="hidden" name="persons|person[0]|education_background_name" value=""/>
			</td>
			<td align="center" width="25%">
			<cpt:select id="prof_title_[index]" name="prof_title" key="title" className="selectWidth2" value="" onChange="initControlValue(this.id)" ></cpt:select>
		    <input type="hidden" name="persons|person[0]|prof_title_value" class="required" label="职称" value=""/>
	        <input type="hidden" name="persons|person[0]|prof_title_name" value=""/>
			</td>
			<td align="center" width="40%"><input name="persons|person[0]|performance"
				class="required input_text " maxlength=200 style="width:90%" label="主要业绩" value=""></td>
			<c:set value="0" var="index" scope="page" />
			<x:forEach select="$xmlData/data/persons/person"
				var="person">
				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
				<tr>
					<td align="center" style="text-align: center" width="5%"><input
						type="radio" class="radiobutton" name="selPersons"></td>
					<td align="center" width="5%"><span
						name="persons/person[${flag}${index}]@seq_no"><x:out
								select="$person/@seq_no" /></span></td>
					<td align="center" width="10%"><input
						name="persons/person[${flag}${index}]/name"
						class="required input_text " maxlength=50 label="姓名"
						value="<x:out select="$person/name"/>" /></td>
					<td align="center" width="5%"><input
						name="persons/person[${flag}${index}]/age"
						class="required input_text "  label="年龄"
						value="<x:out select="$person/age"/>" style="width:50px;text-align: right;" onfocus="InitInput.setNumber(this,3,0,0)"/></td>
					<td align="center" width="10%">
					<c:set var="education_background"><x:out select="$person/education_background_value" /></c:set>
						<cpt:select id="education_background${index}"  className="selectWidth1"  name="education_background" key="educate" onChange="initControlValue(this.id)" value="${education_background }"></cpt:select>
			            <input type="hidden" name="persons/person[${flag}${index}]/education_background_value" value="${education_background}"  class="required input_text " label="最高学历"/>
			            <input type="hidden" name="persons/person[${flag}${index}]/education_background_name" value="<x:out select="$person/education_background_name" />"/>
					</td>
					<td align="center"  width="25%">
					<c:set var="prof_title_value"><x:out select="$person/prof_title_value" /></c:set>
					<cpt:select id="prof_title${index}" className="selectWidth2" name="prof_title" key="title" value="${prof_title_value}" onChange="initControlValue(this.id)" ></cpt:select>
				    <input type="hidden" name="persons/person[${flag}${index}]/prof_title_value" class="required" label="职称" value="<x:out select="$person/prof_title_value" />" />
				    <input type="hidden" name="persons/person[${flag}${index}]/prof_title_name" value="<x:out select="$person/prof_title_name" />"/>
				    </td>
					<td align="center" width="40%"><input
						name="persons/person[${flag}${index}]/performance"
						class="required input_text " maxlength=200 style="width:90%" label="主要业绩"
						value="<x:out select="$person/performance"/>" /></td>
				</tr>
				<c:set value="${index+1}" var="index" scope="page" />
			</x:forEach>
			<script type="text/javascript">
				showAllDateTag("tblPersons");
			</script>
	</tbody>
</table>
<br>
<table width="98%" align="center">
	<tr>
		<td><input class="button" name="cmdAddbefore" type=button
			value="添加"
			onclick="addNewRow('tblPersons');showDateTag('tblPersons');">
			<input class="button" name="cmdMovePrev" type=button value="上移"
			onclick="movePrev('tblPersons','selPersons')"> <input
			class="button" name="cmdMoveNext" type=button value="下移"
			onclick="moveNext('tblPersons','selPersons')"> <input
			class="button" name="cmddel" type=button value="删除"
			onclick="deleteSelectedRow('tblPersons','主要骨干基本情况');"></td>
	</tr>
</table>

<script type="text/javascript">
$(document).ready (function() {
	//var psncnt_master=
	var degree_doctor=$("#degree_doctor").val();
	if(degree_doctor=="")
		degree_doctor=0;
	var degree_master=$("#degree_master").val();
	if(degree_master=="")
		degree_master=0;
	var count=parseInt(degree_doctor)+parseInt(degree_master);
	$("#psncnt_master").text(count);
	initPersonValue("persons_principal");
});

function initPersonValue(tblName){
	  var tbl = $("#" + tblName);
	 
	  tbl.find("input[type=hidden]").each(function(){
			var id=$(this).attr("name");
			
			if(id==null || id=="")
				return true;
			var parentObj=tbl.find("[name$='/"+id+"']");
			
			if(parentObj.val() == null || $.trim(parentObj.val()) == ""){
				var value= $(this).val();
  			parentObj.val(value);
			}
			
		});
	  
}

</script>


<script type="text/javascript">
<!--
//选择机构负责人回调
function selectPsnCall(data) {
	$("input[name$='psn_code']").val(data.person.psnCode);
	$("#persons_principal").find("input[name$='principal_name']").val(data.person.zhName);
	$("#persons_principal").find("input[name$='principal_bod']").val(data.personExtend.basic_info.birthday);
	$("#persons_principal").find("input[name$='principal_position']").val(data.personExtend.basic_info.position);
	$("#persons_principal").find("input[name$='principal_mobile']").val(data.personExtend.contact.mobile);
	$("#persons_principal").find("input[name$='principal_major']").val(data.personExtend.contact.major);
	$("#educate").val(data.personExtend.basic_info.educate_value);
	$("#persons_principal").find("input[name$='educate_value']").val(data.personExtend.basic_info.educate_value);
	$("#persons_principal").find("input[name$='educate_name']").val(data.personExtend.basic_info.educate_name);
	$("#persons_principal").find("input[name$='principal_id_no']").val(data.personExtend.basic_info.card_code);
	tb_remove2();
	//同步单位信息Tab页中的项目负责人信息
	$("span[name='proposal/responsible_name']").text(data.person.zhName);
	$("span[name='proposal/responsible_tel']").text(data.personExtend.contact.tel_work);
	$("span[name='proposal/responsible_mobile']").text(data.personExtend.contact.mobile);
	$("span[name='proposal/responsible_email']").text(data.personExtend.contact.email);
	$("span[name='proposal/responsible_fax']").text(data.personExtend.contact.fax);
}
//-->
</script>
